package day9;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class DelArray {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String[]ar={"dog","Tiger","snake","Cat","goose","duck"};
        for (int i = 0; i <ar.length; i++) {
            System.out.print(ar[i]+" ");
        }
        System.out.println();
        System.out.println("删除第几个(0开始)？");
        int index=in.nextInt();
        //从index+1 开始，直到最后一个，往前移动一下
        for (int i = index+1; i <ar.length ; i++) {
            ar[i-1]=ar[i];
        }
        ar[ar.length-1]=null;
        System.out.println();
        for (int i = 0; i <ar.length; i++) {
            System.out.print(ar[i]+" ");
        }
    }
}
